<!DOCTYPE html>
<html>
	<head>
		<title>Loading from inline datasource</title>
		<link rel="stylesheet" href="../../../codebase/webix.css" type="text/css" charset="utf-8">
		<script src="../../../codebase/webix.js" type="text/javascript" charset="utf-8"></script>

		<link rel="stylesheet" type="text/css" href="../common/samples.css">
		<script src="../common/testdata.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div class='header_comment'>Loading from inline datasource</div>
		<div class='sample_comment'>JSON</div>
		<div id="testA"></div>
		<hr>
		<div class='sample_comment'>XML</div>
		<div id="testB"></div>
		<hr>
		<div class='sample_comment'>CSV</div>
		<div id="testC"></div>
		<hr>
		<div class='sample_comment'>jsArray</div>
		<div id="testD"></div>
		<hr>		
		
		<script type="text/javascript" charset="utf-8">

		webix.ready(function(){
			grida = webix.ui({
				container:"testA",
				view:"datatable",
				columns:[
					{ id:"rank",	header:"", css:"rank",  		width:50},
					{ id:"title",	header:"Film title",width:200},
					{ id:"year",	header:"Released" , width:80},
					{ id:"votes",	header:"Votes", 	width:100}
				],
				autoheight:true,
				autowidth:true,
				data: [
					{ id:1, title:"The Shawshank Redemption", year:1994, votes:678790, rating:9.2, rank:1},
					{ id:2, title:"The Godfather", year:1972, votes:511495, rating:9.2, rank:2}
				]
			});	
			
			gridb = webix.ui({
				container:"testB",
				view:"datatable",
				columns:[
					{ id:"rank",	header:"", css:"rank",  		width:50},
					{ id:"title",	header:"Film title",width:200},
					{ id:"year",	header:"Released" , width:80},
					{ id:"votes",	header:"Votes", 	width:100}
				],
				autoheight:true,
				autowidth:true,

				datatype:"xml",
				data:'<data><item id="1" title="The Shawshank Redemption" year="1994" votes="678790" rating="9.2" rank="1" /><item id="2" title="The Godfather" year="1972" votes="511495" rating="9.2" rank="2" /></data>'

			});	
			
			
			gridc = webix.ui({
				container:"testC",
				view:"datatable",
				columns:[
					{ id:"data5",	header:"", css:"rank",  		width:50},
					{ id:"data1",	header:"Film title",width:200},
					{ id:"data2",	header:"Released" , width:80},
					{ id:"data3",	header:"Votes", 	width:100}
				],
				autoheight:true,
				autowidth:true,

				datatype:"csv",
				data:'1,The Shawshank Redemption,1994,678790,9.2,1\n2,The Godfather,1972,511495,9.2,2'
			});	
			
			gridd = webix.ui({
				container:"testD",
				view:"datatable",
				columns:[
					{ id:"data5",	header:"", css:"rank",  		width:50},
					{ id:"data1",	header:"Film title",width:200},
					{ id:"data2",	header:"Released" , width:80},
					{ id:"data3",	header:"Votes", 	width:100}
				],
				autoheight:true,
				autowidth:true,

				datatype:"jsarray",
				data:[
					[1,"The Shawshank Redemption",1994,678790,9.2,1],
					[2,"The Godfather",1972,511495,9.2,2]
				]
			});								
		});
		</script>
	</body>
</html>